import router from '@/router'
import store from '@/vuex'
const whitelist = [
  '/login'
]
router.beforeEach((to,from,next) => {
  if(whitelist.indexOf(to.path) !== -1) {
    next()
  } else {
      if(store.getters.getToken) {
        next()
      } else {
        next('/login')
      }
  }
})
export default router